<!DOCTYPE html>

<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

<title>class Trello::Client - RDoc Documentation</title>

<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
</script>

<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>


<body id="top" class="class">
<nav id="metadata">
  <nav id="home-section" class="section">
  <h3 class="section-header">
    <a href="../index.html">Home</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </h3>
</nav>


  <nav id="search-section" class="section project-section" class="initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <h3 class="section-header">
      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">
    </h3>
  </form>

  <ul id="search-results" class="initially-hidden"></ul>
</nav>


  <div id="file-metadata">
    <nav id="file-list-section" class="section">
  <h3 class="section-header">Defined In</h3>
  <ul>
    <li>lib/trello/client.rb
  </ul>
</nav>

    
  </div>

  <div id="class-metadata">
    
    <nav id="parent-class-section" class="section">
  <h3 class="section-header">Parent</h3>
  
  <p class="link"><a href="../Object.html">Object</a>
  
</nav>

    <!-- Included Modules -->
<nav id="includes-section" class="section">
  <h3 class="section-header">Included Modules</h3>

  <ul class="link-list">
  
  
    <li><a class="include" href="Authorization.html">Trello::Authorization</a>
  
  
  </ul>
</nav>

    <!-- Method Quickref -->
<nav id="method-list-section" class="section">
  <h3 class="section-header">Methods</h3>

  <ul class="link-list">
    
    <li><a href="#method-c-new">::new</a>
    
    <li><a href="#method-i-auth_policy">#auth_policy</a>
    
    <li><a href="#method-i-configuration">#configuration</a>
    
    <li><a href="#method-i-configure">#configure</a>
    
    <li><a href="#method-i-create">#create</a>
    
    <li><a href="#method-i-delete">#delete</a>
    
    <li><a href="#method-i-find">#find</a>
    
    <li><a href="#method-i-find_many">#find_many</a>
    
    <li><a href="#method-i-get">#get</a>
    
    <li><a href="#method-i-post">#post</a>
    
    <li><a href="#method-i-put">#put</a>
    
  </ul>
</nav>

  </div>

  <div id="project-metadata">
    <nav id="fileindex-section" class="section project-section">
  <h3 class="section-header">Pages</h3>

  <ul>
  
    <li class="file"><a href="../Gemfile.html">Gemfile</a>
  
    <li class="file"><a href="../LICENSE.html">LICENSE</a>
  
    <li class="file"><a href="../Rakefile.html">Rakefile</a>
  
  </ul>
</nav>

    <nav id="classindex-section" class="section project-section">
  <h3 class="section-header">Class and Module Index</h3>

  <ul class="link-list">
  
    <li><a href="../Trello.html">Trello</a>
  
    <li><a href="../Trello/Action.html">Trello::Action</a>
  
    <li><a href="../Trello/Association.html">Trello::Association</a>
  
    <li><a href="../Trello/AssociationProxy.html">Trello::AssociationProxy</a>
  
    <li><a href="../Trello/Attachment.html">Trello::Attachment</a>
  
    <li><a href="../Trello/Authorization.html">Trello::Authorization</a>
  
    <li><a href="../Trello/Authorization/BasicAuthPolicy.html">Trello::Authorization::BasicAuthPolicy</a>
  
    <li><a href="../Trello/Authorization/Clock.html">Trello::Authorization::Clock</a>
  
    <li><a href="../Trello/Authorization/Nonce.html">Trello::Authorization::Nonce</a>
  
    <li><a href="../Trello/Authorization/OAuthPolicy.html">Trello::Authorization::OAuthPolicy</a>
  
    <li><a href="../Trello/BasicData.html">Trello::BasicData</a>
  
    <li><a href="../Trello/Board.html">Trello::Board</a>
  
    <li><a href="../Trello/Card.html">Trello::Card</a>
  
    <li><a href="../Trello/CheckItemState.html">Trello::CheckItemState</a>
  
    <li><a href="../Trello/Checklist.html">Trello::Checklist</a>
  
    <li><a href="../Trello/Client.html">Trello::Client</a>
  
    <li><a href="../Trello/Configuration.html">Trello::Configuration</a>
  
    <li><a href="../Trello/Error.html">Trello::Error</a>
  
    <li><a href="../Trello/HasActions.html">Trello::HasActions</a>
  
    <li><a href="../Trello/InvalidAccessToken.html">Trello::InvalidAccessToken</a>
  
    <li><a href="../Trello/Item.html">Trello::Item</a>
  
    <li><a href="../Trello/Label.html">Trello::Label</a>
  
    <li><a href="../Trello/LabelName.html">Trello::LabelName</a>
  
    <li><a href="../Trello/List.html">Trello::List</a>
  
    <li><a href="../Trello/Member.html">Trello::Member</a>
  
    <li><a href="../Trello/MultiAssociation.html">Trello::MultiAssociation</a>
  
    <li><a href="../Trello/Notification.html">Trello::Notification</a>
  
    <li><a href="../Trello/Organization.html">Trello::Organization</a>
  
    <li><a href="../Trello/TInternet.html">Trello::TInternet</a>
  
    <li><a href="../Trello/Token.html">Trello::Token</a>
  
    <li><a href="../IntegrationTest.html">IntegrationTest</a>
  
    <li><a href="../IntegrationTest/Container.html">IntegrationTest::Container</a>
  
    <li><a href="../Helpers.html">Helpers</a>
  
    <li><a href="../Object.html">Object</a>
  
    <li><a href="../String.html">String</a>
  
  </ul>
</nav>

  </div>
</nav>

<div id="documentation">
  <h1 class="class">class Trello::Client</h1>

  <div id="description" class="description">
    
  </div><!-- description -->

  
  
  
  <section id="5Buntitled-5D" class="documentation-section">
    

    

    

    

    <!-- Methods -->
    
     <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
      <h3 class="section-header">Public Class Methods</h3>

    
      <div id="method-c-new" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">new</span><span
            class="method-args">(attrs = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File lib/trello/client.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">attrs</span> = {})
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">attributes</span> = <span class="ruby-identifier">attrs</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- new-source -->
          
        </div>

        

        
      </div><!-- new-method -->

    
    </section><!-- public-class-method-details -->
  
     <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
      <h3 class="section-header">Public Instance Methods</h3>

    
      <div id="method-i-auth_policy" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">auth_policy</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="auth_policy-source">
            <pre><span class="ruby-comment"># File lib/trello/client.rb, line 79</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">auth_policy</span>
  <span class="ruby-ivar">@auth_policy</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">auth_policy_class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">credentials</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- auth_policy-source -->
          
        </div>

        

        
      </div><!-- auth_policy-method -->

    
      <div id="method-i-configuration" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">configuration</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="configuration-source">
            <pre><span class="ruby-comment"># File lib/trello/client.rb, line 75</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">configuration</span>
  <span class="ruby-ivar">@configuration</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">new</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- configuration-source -->
          
        </div>

        

        
      </div><!-- configuration-method -->

    
      <div id="method-i-configure" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">configure</span><span
            class="method-args">() { |configuration| ... }</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="configure-source">
            <pre><span class="ruby-comment"># File lib/trello/client.rb, line 71</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">configure</span>
  <span class="ruby-keyword">yield</span> <span class="ruby-identifier">configuration</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- configure-source -->
          
        </div>

        

        
      </div><!-- configure-method -->

    
      <div id="method-i-create" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">create</span><span
            class="method-args">(path, options)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Creates resource with given options (attributes)</p>

<p>Examples:</p>

<pre>client.create(:member, options)
client.create(:board, options)</pre>
          

          
          <div class="method-source-code" id="create-source">
            <pre><span class="ruby-comment"># File lib/trello/client.rb, line 64</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">options</span>)
  <span class="ruby-identifier">trello_class</span> = <span class="ruby-identifier">class_from_path</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-identifier">trello_class</span>.<span class="ruby-identifier">save</span> <span class="ruby-identifier">options</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">data</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">data</span>.<span class="ruby-identifier">client</span> = <span class="ruby-keyword">self</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- create-source -->
          
        </div>

        

        
      </div><!-- create-method -->

    
      <div id="method-i-delete" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">delete</span><span
            class="method-args">(path)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="delete-source">
            <pre><span class="ruby-comment"># File lib/trello/client.rb, line 31</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-node">&quot;https://api.trello.com/#{API_VERSION}#{path}&quot;</span>)
  <span class="ruby-identifier">invoke_verb</span>(<span class="ruby-value">:delete</span>, <span class="ruby-identifier">uri</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- delete-source -->
          
        </div>

        

        
      </div><!-- delete-method -->

    
      <div id="method-i-find" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">find</span><span
            class="method-args">(path, id)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Finds given resource by id</p>

<p>Examples:</p>

<pre>client.find(:board, &quot;board1234&quot;)
client.find(:member, &quot;user1234&quot;)</pre>
          

          
          <div class="method-source-code" id="find-source">
            <pre><span class="ruby-comment"># File lib/trello/client.rb, line 42</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">find</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">id</span>)
  <span class="ruby-identifier">response</span> = <span class="ruby-identifier">get</span>(<span class="ruby-node">&quot;/#{path.to_s.pluralize}/#{id}&quot;</span>)
  <span class="ruby-identifier">trello_class</span> = <span class="ruby-identifier">class_from_path</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-identifier">trello_class</span>.<span class="ruby-identifier">parse</span> <span class="ruby-identifier">response</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">data</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">data</span>.<span class="ruby-identifier">client</span> = <span class="ruby-keyword">self</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- find-source -->
          
        </div>

        

        
      </div><!-- find-method -->

    
      <div id="method-i-find_many" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">find_many</span><span
            class="method-args">(trello_class, path, params = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Finds given resource by path with params</p>
          

          
          <div class="method-source-code" id="find_many-source">
            <pre><span class="ruby-comment"># File lib/trello/client.rb, line 51</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">find_many</span>(<span class="ruby-identifier">trello_class</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span> = {})
  <span class="ruby-identifier">response</span> = <span class="ruby-identifier">get</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span>)
  <span class="ruby-identifier">trello_class</span>.<span class="ruby-identifier">parse_many</span> <span class="ruby-identifier">response</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">data</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">data</span>.<span class="ruby-identifier">client</span> = <span class="ruby-keyword">self</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- find_many-source -->
          
        </div>

        

        
      </div><!-- find_many-method -->

    
      <div id="method-i-get" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">get</span><span
            class="method-args">(path, params = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="get-source">
            <pre><span class="ruby-comment"># File lib/trello/client.rb, line 15</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span> = {})
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-node">&quot;https://api.trello.com/#{API_VERSION}#{path}&quot;</span>)
  <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query_values</span> = <span class="ruby-identifier">params</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-identifier">invoke_verb</span>(<span class="ruby-value">:get</span>, <span class="ruby-identifier">uri</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- get-source -->
          
        </div>

        

        
      </div><!-- get-method -->

    
      <div id="method-i-post" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">post</span><span
            class="method-args">(path, body = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="post-source">
            <pre><span class="ruby-comment"># File lib/trello/client.rb, line 21</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">post</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">body</span> = {})
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-node">&quot;https://api.trello.com/#{API_VERSION}#{path}&quot;</span>)
  <span class="ruby-identifier">invoke_verb</span>(<span class="ruby-value">:post</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">body</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- post-source -->
          
        </div>

        

        
      </div><!-- post-method -->

    
      <div id="method-i-put" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">put</span><span
            class="method-args">(path, body = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="put-source">
            <pre><span class="ruby-comment"># File lib/trello/client.rb, line 26</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">put</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">body</span> = {})
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-node">&quot;https://api.trello.com/#{API_VERSION}#{path}&quot;</span>)
  <span class="ruby-identifier">invoke_verb</span>(<span class="ruby-value">:put</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">body</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- put-source -->
          
        </div>

        

        
      </div><!-- put-method -->

    
    </section><!-- public-instance-method-details -->
  
  </section><!-- 5Buntitled-5D -->

</div><!-- documentation -->


<footer id="validator-badges">
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
  <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>

